package com.feiyi.app.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.feiyi.app.R;
import com.feiyi.app.bean.ClassifyLeftBean;

import java.util.List;

/**
 * 作者 : wlt
 * 创建时间:  2018-07-15
 * QQ : 1346947404
 * 邮箱:wanglt_android@163.com
 * 类说明:
 * In me the tiger sniffs the rose
 */

public class ClassifyLeftAdapter extends BaseQuickAdapter<ClassifyLeftBean.DataBean,BaseViewHolder> {

    public ClassifyLeftAdapter(int layoutResId, @Nullable List<ClassifyLeftBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ClassifyLeftBean.DataBean item) {

        if (item.isSelect()){
            helper.setBackgroundRes(R.id.rl_left_container,R.color.transparent);
            helper.setTextColor(R.id.tv_classify_left_name,mContext.getResources().getColor(R.color.red));
        }else {
            helper.setBackgroundRes(R.id.rl_left_container,R.color.white);
            helper.setTextColor(R.id.tv_classify_left_name,mContext.getResources().getColor(R.color.black));
        }

        helper.setText(R.id.tv_classify_left_name,item.getName());
    }
}
